# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=libwnck3
pkgver=3.30.0
pkgrel=1
pkgdesc="Library to manage X windows and workspaces (via pagers, tasklists, etc.)"
url="https://gitlab.gnome.org/GNOME/libwnck"
arch=(x86_64)
license=(LGPL)
depends=(gtk3 startup-notification libxres)
makedepends=(gobject-introspection gtk-doc autoconf-archive git)
_commit=83548dda1c15789ad50eb1823731c17864cbb951  # tags/3.30.0^0
source=("git+https://gitlab.gnome.org/GNOME/libwnck.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
    cd libwnck
    git describe --tags | sed 's/-/+/g'
}

prepare() {
    cd libwnck
    NOCONFIGURE=1 ./autogen.sh
}

build() {
    cd libwnck
    ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
        --disable-static --enable-gtk-doc --enable-compile-warnings=minimum

    # https://bugzilla.gnome.org/show_bug.cgi?id=655517
    sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

    make
}

check() {
    cd libwnck
    make -k check
}

package() {
    cd libwnck
    make DESTDIR="$pkgdir" install
}

# vim:set sw=4 et:
